﻿using UnityEngine;
using System.Collections;

public class OnTriggerGO : MonoBehaviour {


    Animator anim;
    void OnTriggerEnter2D(Collider2D coll)
    {

        if (coll.gameObject.tag == "Player")
        {
            GameObject gb = gameObject.transform.GetChild(0).gameObject;
            anim = gb.GetComponent<Animator>();
            anim.SetBool("Fall", true);
            StartCoroutine(waitForAwhile());
            
        }
    }
    IEnumerator waitForAwhile()
    {
        yield return new WaitForSeconds(0.2f);
        anim.SetBool("Fall", false);
    }
}
